package kr.co.doriclassic.pro12;

public class ThreeDimShape extends Shape {
	@Override
	public void getVolume() {
		System.out.print("3차원 ");
	}	
}
class Shpere extends ThreeDimShape{
	int redius;
	static final double PI=3.14;
	public Shpere(int redius) {
		this.redius = redius;
	}
	@Override
	public void getVolume() {
		super.getVolume();
		System.out.println("구의 부피="+(4/3*PI*redius*redius*redius));
	}	
}
class Cube extends ThreeDimShape{
	private int width;
	private int length;
	private int height;
	public Cube(int width, int length, int height) {
		this.width = width;
		this.length = length;
		this.height = height;
	}
	@Override
	public void getVolume() {
		super.getVolume();
		System.out.println("사면체 부피="+(width*length*height));
	}
}
class Cylinder extends ThreeDimShape{
	private int redius;
	private int height;
	static final double PI=3.14;
	public Cylinder(int redius, int height) {
		this.redius = redius;
		this.height = height;
	}
	@Override
	public void getVolume() {
		super.getVolume();
		System.out.println("원기둥의 부피="+(PI*redius*redius*height));
	}
}